<?php
ob_start();

session_start();
error_reporting(E_ALL|E_STRICT);
error_reporting(1);
defined('SITE_BASE_DIR') || define('SITE_BASE_DIR', realpath(dirname(__FILE__)));
include SITE_BASE_DIR."/config/config.php";
include SITE_BASE_DIR."/config/init.php";

if($_SESSION['lang']=='en'){
    include SITE_BASE_DIR."/lang/lang.php";
    ob_start("obCallBackEn");
}else{
    $_SESSION['lang']='vn';
    include SITE_BASE_DIR."/lang/lang.php";
    ob_start("obCallBackVn");
}

if(!check_login_single()) {
    @header("location: ".get_link("member"));
    exit();
}

$params =explode('/',input('params','GET'));
$params = xmlseo($params);

$param  = explode_param($params[1]);

// Main
include SITE_INCLUDE_DIR."/header.php";

switch($params[0]) {

    case $CONFIG_MODULE["property"]: {
       
            include SITE_MODULE_DIR.'/property/functions/property-functions.php';
            include SITE_MODULE_DIR.'/property/property_index.php';
            break;
    }case $CONFIG_MODULE["news"]  : {
            include SITE_MODULE_DIR.'/news/functions/news-functions.php';
            include SITE_MODULE_DIR.'/news/news_index.php';
            break;
    }case $CONFIG_MODULE["faq"]   : {
            include SITE_MODULE_DIR.'/faq/functions/faq-functions.php';
            include SITE_MODULE_DIR.'/faq/faq_index.php';
            break;
    }case $CONFIG_MODULE["search"]: {
            include SITE_MODULE_DIR.'/search/functions/search-functions.php';
            include SITE_MODULE_DIR.'/search/search_index.php';
            break;
	}case $CONFIG_MODULE["register"]: {

            include SITE_MODULE_DIR.'/register/functions/register-functions.php';
            include SITE_MODULE_DIR.'/register/register.php';
            break;
	}case $CONFIG_MODULE["success"]: {
            include SITE_MODULE_DIR.'/register/success.php';
            break;
	}case "kich-hoat-tai-khoan": {
            include SITE_MODULE_DIR.'/register/functions/register-functions.php';
            include SITE_MODULE_DIR.'/register/confirm.php';
            break;
        }case $CONFIG_MODULE["intro"]: {
            include SITE_MODULE_DIR.'/intro/functions/intro-functions.php';
            include SITE_MODULE_DIR.'/intro/intro_index.php';
            break;
        }case $CONFIG_MODULE["projects"]: {
            include SITE_MODULE_DIR.'/project/functions/project-functions.php';
            include SITE_MODULE_DIR.'/project/project_index.php';
            break;
         }case $CONFIG_MODULE["documents"]: {
            include SITE_MODULE_DIR.'/doc/functions/doc-functions.php';
            include SITE_MODULE_DIR.'/doc/doc_index.php';
            break;
        }case $CONFIG_MODULE["member"]: {
            include SITE_MODULE_DIR.'/member/functions/member-functions.php';
            include SITE_MODULE_DIR.'/member/functions/message-functions.php';
            include SITE_MODULE_DIR.'/member/member_index.php';           
            break;
        }case $CONFIG_MODULE["contact"]: {
            include SITE_MODULE_DIR.'/contact/functions/contact-functions.php';
            include SITE_MODULE_DIR.'/contact/contact_index.php';
            break;
         }case $CONFIG_MODULE["video"]: {
            include SITE_MODULE_DIR.'/video/functions/video-functions.php';
            include SITE_MODULE_DIR.'/video/video_index.php';
            break;
    } default: {
            include SITE_MODULE_DIR.'/home/functions/home-functions.php';
            include SITE_MODULE_DIR."/home/home_index.php" ;
            break;
        }

}

include SITE_INCLUDE_DIR."/footer.php";

ob_end_flush();
?>